package com.man.config;

import com.man.interceptors.LoginInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @CallsName: WebConfig
 * 配置类
 * 注册拦截器
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {
    @Autowired
    private LoginInterceptor loginInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
            /*把拦截器注册进去*/ /*拦截了所有的请求*/// .       //登录和注册接口不拦截(修改密码)
        registry.addInterceptor(loginInterceptor).excludePathPatterns("/login", "/register", "/resources/static/**", "/static/**", "/js/**", "/css/**", "/images/**");
    }
}
